package com.dict.process;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.dict.classes.User;

public class AddUserProcess {

	public void doProcess(HttpServletRequest request,
            HttpServletResponse response) throws Exception {
		
		String strUsername = request.getParameter("username");
		String strPassword = request.getParameter("password");
		
		User user = new User();
		user.setUsername(strUsername);
		user.setPassword(strPassword);
		
		try {
			user.store();
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		finally 
		{
			response.sendRedirect("index.jsp?content=allUsers");
		}
	}
}
